﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Index.aspx.cs" Inherits="Enterprise.UI.Web.Modules.OfficeDocument.Index" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" type="text/css" href="../../Styles/css/gridview.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPH" runat="server">
    <div class="vDaohangtiaoHolder module">
        <div class="vDaohangtiao">
            <ul>
                <li class="first">
                    <a href="/index.aspx" title="首页">首页</a>
                </li>
                <li class="last">公文管理
                </li>
            </ul>
        </div>
    </div>
    <Ent:HeadMenuWeb ID="HeadMenu1" runat="server">
    </Ent:HeadMenuWeb>
    <div id="p" class="easyui-panel" style="border: 0px;" fit="true"
        collapsible="false" minimizable="false" maximizable="false" closable="false">
        <div class="easyui-tabs" fit="true" plain="true">
            <div title="公文列表" style="padding: 10px;">
                <%--    <div style="padding: 5px;">
        搜索条件：<asp:DropDownList ID="s_Type" runat="server">
            <asp:ListItem Text="标题" Value="ATitle"></asp:ListItem>
            <asp:ListItem Text="内容" Value="AContent"></asp:ListItem>
        </asp:DropDownList>
        关键字：<asp:TextBox ID="s_Key" runat="server"></asp:TextBox>
        <asp:LinkButton ID="Bt_Search" runat="server" Text="检索" CssClass="easyui-linkbutton"
            plain="false" OnClick="Bt_Search_OnClick"></asp:LinkButton>
    </div>--%>
                <asp:GridView ID="GridView1" runat="server" DataKeyNames="ODID" CssClass="GridViewStyle"
                    AutoGenerateColumns="False" Width="100%" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField HeaderText="序号" ItemStyle-Width="30">
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="公文编号" DataField="ODCODE" ItemStyle-Width="80"/>
                        <asp:TemplateField HeaderText="公文名称">
                            <ItemTemplate>
                                <a href="Detail.aspx?ODID=<%#Eval("ODID") %>">
                                    <%#Eval("ODCName") %></a>
                            </ItemTemplate>
                            <ItemStyle Wrap="False" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="发布时间" DataField="ODPUBLICTIME" DataFormatString="{0:yyyy-MM-dd}"  ItemStyle-Width="80"/>                        
                    </Columns>
                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                    <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PageButtonCount="5"
                        PreviousPageText="上一页" />
                    <PagerStyle CssClass="GridViewPagerStyle" />
                </asp:GridView>
            </div>
            <div title="我起草的公文" style="padding: 10px;">
                <asp:GridView ID="GridView2" runat="server" DataKeyNames="ODID" CssClass="GridViewStyle"
                    AutoGenerateColumns="False" Width="100%">
                    <Columns>
                        <asp:TemplateField HeaderText="序号" ItemStyle-Width="30">
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="名称(中文)">
                            <ItemTemplate>
                                <a href="OfficeDocumentDetail.aspx?ODID=<%#Eval("ODID") %>">
                                    <%#Eval("ODCName") %></a>
                            </ItemTemplate>
                            <ItemStyle Wrap="False" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="俄文(中文)">
                            <ItemTemplate>
                                <%#Eval("ODRName") %>
                            </ItemTemplate>
                            <ItemStyle Wrap="False" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="起草时间" DataField="ODCREATETIME" DataFormatString="{0:yyyy-MM-dd}"
                            ItemStyle-Width="80" />
                        <asp:TemplateField HeaderText="状态" ItemStyle-Width="80">
                            <ItemTemplate>
                                <%#Enterprise.Service.WorkFlow.WorkFlowService.GetWorkFlowState((string)Eval("ODID"),(int)Eval("ODSTATE")) %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="发布状态" ItemStyle-Width="60">
                            <ItemTemplate>
                                <%#GetPublicState((string)Eval("ODID"), (int)Eval("ODSTATE"), (int)Eval("ODISPUBLIC"), (int)Eval("ODUSERID"))%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="80" HeaderText="操作">
                            <ItemTemplate>
                                <%#(int)Eval("ODSTATE")==1?"":"<a href=\" Manage.aspx?Id="+Eval("ODID")+"&Cmd=Revo\" onclick=\"javascript:return confirm('确认要撤销起草的公文吗？ 撤销将不可恢复！')\">撤销公文</a>" %>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                </asp:GridView>
            </div>
            <div title="待发布的公文" style="padding: 10px;" id="dPublic" runat="server">
                <asp:GridView ID="GridView3" runat="server" DataKeyNames="ODID" CssClass="GridViewStyle"
                    AutoGenerateColumns="False" Width="100%">
                    <Columns>
                        <asp:TemplateField HeaderText="序号" ItemStyle-Width="30" >
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1%>
                            </ItemTemplate>
                            <ItemStyle Wrap="False" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="来文时间" DataField="ODFROMTIME"  ItemStyle-Width="100"/>
                        <asp:BoundField HeaderText="来文单位" DataField="ODFROM"  ItemStyle-Width="100"/>
                        <asp:TemplateField HeaderText="名称(中文)">
                            <ItemTemplate>
                                <%#Eval("ODCName") %>
                            </ItemTemplate>
                            <ItemStyle Wrap="False" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="部门" ItemStyle-Width="60" >
                            <ItemTemplate>
                                <%#Enterprise.Service.Department.DepartmentService.GetDepartMentName((int)Eval("ODDEPTID")) %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="发布人" ItemStyle-Width="60" >
                            <ItemTemplate>
                                <%#Enterprise.Service.User.UserService.GetUserName((int)Eval("ODUSERID")) %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="起草时间" DataField="ODCREATETIME" DataFormatString="{0:yyyy-MM-dd}" ItemStyle-Width="80" />
                        <asp:TemplateField HeaderText="操作" ItemStyle-Width="40" >
                            <ItemTemplate>
                            <a href="Manage.aspx?Id=<%#Eval("ODID") %>&typeId=<%#Eval("ODTYPEID") %>&Cmd=Public">发 布</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                </asp:GridView>
            </div>
        </div>
    </div>
</asp:Content>
